/**
 * 文件名：StatisticsController.java
 *
 * 创建人：Fyh - 1009173473@qq.com
 *
 * 创建时间：2019年1月28日 下午3:18:49
 *
 * 版权所有：南京植百汇智能科技服务有限公司
 */
package com.z100h.supplychain.statistics.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.z100h.supplychain.statistics.entity.ResourceLogEvent;
import com.z100h.supplychain.statistics.entity.SkuRealtimeInventory;
import com.z100h.supplychain.statistics.service.StatisticsService;

/**
 * [描述信息：说明类的基本功能]
 *
 * @author Fyh - 1009173473@qq.com
 * @version 1.0 Created on 2019年1月28日 下午3:18:49
 */
@Controller
@RequestMapping(value = "${adminPath}/statistics")
public class StatisticsController {

	@Autowired
	private StatisticsService statisticsService;
	
	@RequestMapping(value ="realtimeSku")
    public String index(HttpServletRequest request, HttpServletResponse response, Model model) {
        return "supplychain/statistics/realtimeSku";
    }
	
	@RequestMapping(value ="findSkuRealtimeInventory")
	@ResponseBody
	public List<SkuRealtimeInventory> findSkuRealtimeInventory(){
		return statisticsService.statSkuRealtimeInventory();
	}
	
	@RequestMapping(value ="getResourceLogById")
	@ResponseBody
	public List<ResourceLogEvent> getResourceLogById(String id){
		return statisticsService.getResourceLogById(id);
	}
	
	/**
	 * 
	 * 获取扫码的ip地址
	 * 
	 * @param label
	 * @return
	 * @author: Fyh - 1009173473@qq.com 
	 * @date: Created on 2019年2月15日 下午2:20:06
	 */
	@RequestMapping(value ="getIp")
	@ResponseBody
	public String getIp(String label){
		String value = statisticsService.getIp(label);
		return value;
	}
}
